<?php
/*
 * @Author: 李明
 * @Date: 2021-10-26 15:08:50
 * @LastEditTime: 2021-12-01 21:35:40
 * @LastEditors: 李明
 * @Description: 
 * @FilePath: /CRM2.0-PHP/app/Models/WorkingFamily.php
 * @山东壹零贰肆信息科技有限公司
 */

/**
 * Created by Reliese Model.
 */

namespace App\Models;

use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;

/**
 * Class WorkingFamily
 * 
 * @property int $id
 * @property string|null $account_name
 * @property string|null $account
 * @property string|null $open_bank
 * @property string|null $tel
 * @property string|null $ein
 * @property string|null $company_address
 * @property string|null $is_default
 * @property int $is_able
 * @property Carbon|null $create_time
 * @property Carbon|null $update_time
 * 
 * @property Collection|FamiliesMoneyRecord[] $families_money_records
 * @property Collection|Order[] $orders
 *
 * @package App\Models
 */
class WorkingFamily extends Model
{
    protected $table = 'working_families';

    protected $casts = [
        'is_able' => 'int'
    ];

    protected $fillable = [
        'account_name',
        'account',
        'open_bank',
        'tel',
        'ein',
        'company_address',
        'is_default',
        'is_able'
    ];

    public function families_money_records()
    {
        return $this->hasMany(FamiliesMoneyRecord::class, 'families_id');
    }

    public function orders()
    {
        return $this->hasMany(Order::class, 'families_id');
    }
}
